package com.platform.comm.exceptions;

public class ErrorCode implements IErrorCode {

    private final String prefix;
    private final Integer errorNo;

    public ErrorCode() {
        this.prefix = "";
        this.errorNo = 0;
    }

    @Override
    public String toString() {
        return String.format("%s%06d", this.prefix, this.errorNo);
    }

    public String getPrefix() {
        return prefix;
    }

    @Override
    public Integer getErrorNo() {
        return errorNo;
    }

    @Override
    public String getErrorCode() {
        return String.format("%s%06d", this.prefix, this.errorNo);
    }

    @Override
    public String getErrorMessage() {
        return "";
    }

    @Override
    public String buildErrorMessage(String message) {
        return String.format("[%s] %s", getErrorCode(), message);
    }

}
